Integrand size = 25, antiderivative size = 91 \[ \int \frac {(3+b \sin (e+f x))^2}{c+d \sin (e+f x)} \, dx=-\frac {b (b c-6 d) x}{d^2}+\frac {2 (b c-3 d)^2 \arctan \left (\frac {d+c \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {c^2-d^2}}\right )}{d^2 \sqrt {c^2-d^2} f}-\frac {b^2 \cos (e+f x)}{d f} \]
-b*(-2*a*d+b*c)*x/d^2-b^2*cos(f*x+e)/d/f+2*(-a*d+b*c)^2*arctan((d+c*tan(1/ 2*f*x+1/2*e))/(c^2-d^2)^(1/2))/d^2/f/(c^2-d^2)^(1/2)
Time = 0.74 (sec) , antiderivative size = 87, normalized size of antiderivative = 0.96 \[ \int \frac {(3+b \sin (e+f x))^2}{c+d \sin (e+f x)} \, dx=-\frac {b (b c-6 d) (e+f x)-\frac {2 (b c-3 d)^2 \arctan \left (\frac {d+c \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {c^2-d^2}}\right )}{\sqrt {c^2-d^2}}+b^2 d \cos (e+f x)}{d^2 f} \]
-((b*(b*c - 6*d)*(e + f*x) - (2*(b*c - 3*d)^2*ArcTan[(d + c*Tan[(e + f*x)/ 2])/Sqrt[c^2 - d^2]])/Sqrt[c^2 - d^2] + b^2*d*Cos[e + f*x])/(d^2*f))
Time = 0.47 (sec) , antiderivative size = 104, normalized size of antiderivative = 1.14, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.320, Rules used = {3042, 3225, 3042, 3214, 3042, 3139, 1083, 217}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {(a+b \sin (e+f x))^2}{c+d \sin (e+f x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {(a+b \sin (e+f x))^2}{c+d \sin (e+f x)}dx\) |
\(\Big \downarrow \) 3225 |
\(\displaystyle \frac {\int \frac {a^2 d-b (b c-2 a d) \sin (e+f x)}{c+d \sin (e+f x)}dx}{d}-\frac {b^2 \cos (e+f x)}{d f}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int \frac {a^2 d-b (b c-2 a d) \sin (e+f x)}{c+d \sin (e+f x)}dx}{d}-\frac {b^2 \cos (e+f x)}{d f}\) |
\(\Big \downarrow \) 3214 |
\(\displaystyle \frac {\frac {(b c-a d)^2 \int \frac {1}{c+d \sin (e+f x)}dx}{d}-\frac {b x (b c-2 a d)}{d}}{d}-\frac {b^2 \cos (e+f x)}{d f}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\frac {(b c-a d)^2 \int \frac {1}{c+d \sin (e+f x)}dx}{d}-\frac {b x (b c-2 a d)}{d}}{d}-\frac {b^2 \cos (e+f x)}{d f}\) |
\(\Big \downarrow \) 3139 |
\(\displaystyle \frac {\frac {2 (b c-a d)^2 \int \frac {1}{c \tan ^2\left (\frac {1}{2} (e+f x)\right )+2 d \tan \left (\frac {1}{2} (e+f x)\right )+c}d\tan \left (\frac {1}{2} (e+f x)\right )}{d f}-\frac {b x (b c-2 a d)}{d}}{d}-\frac {b^2 \cos (e+f x)}{d f}\) |
\(\Big \downarrow \) 1083 |
\(\displaystyle \frac {-\frac {4 (b c-a d)^2 \int \frac {1}{-\left (2 d+2 c \tan \left (\frac {1}{2} (e+f x)\right )\right )^2-4 \left (c^2-d^2\right )}d\left (2 d+2 c \tan \left (\frac {1}{2} (e+f x)\right )\right )}{d f}-\frac {b x (b c-2 a d)}{d}}{d}-\frac {b^2 \cos (e+f x)}{d f}\) |
\(\Big \downarrow \) 217 |
\(\displaystyle \frac {\frac {2 (b c-a d)^2 \arctan \left (\frac {2 c \tan \left (\frac {1}{2} (e+f x)\right )+2 d}{2 \sqrt {c^2-d^2}}\right )}{d f \sqrt {c^2-d^2}}-\frac {b x (b c-2 a d)}{d}}{d}-\frac {b^2 \cos (e+f x)}{d f}\) |
(-((b*(b*c - 2*a*d)*x)/d) + (2*(b*c - a*d)^2*ArcTan[(2*d + 2*c*Tan[(e + f* x)/2])/(2*Sqrt[c^2 - d^2])])/(d*Sqrt[c^2 - d^2]*f))/d - (b^2*Cos[e + f*x]) /(d*f)
3.7.82.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[-b, 2])^( -1))*ArcTan[Rt[-b, 2]*(x/Rt[-a, 2])], x] /; FreeQ[{a, b}, x] && PosQ[a/b] & & (LtQ[a, 0] || LtQ[b, 0])
Int[((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Simp[-2 Subst[I nt[1/Simp[b^2 - 4*a*c - x^2, x], x], x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x]
Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = Fre eFactors[Tan[(c + d*x)/2], x]}, Simp[2*(e/d) Subst[Int[1/(a + 2*b*e*x + a *e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}, x] && NeQ [a^2 - b^2, 0]
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])/((c_.) + (d_.)*sin[(e_.) + (f_. )*(x_)]), x_Symbol] :> Simp[b*(x/d), x] - Simp[(b*c - a*d)/d Int[1/(c + d *Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0]
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^2/((c_.) + (d_.)*sin[(e_.) + (f _.)*(x_)]), x_Symbol] :> Simp[(-b^2)*(Cos[e + f*x]/(d*f)), x] + Simp[1/d Int[Simp[a^2*d - b*(b*c - 2*a*d)*Sin[e + f*x], x]/(c + d*Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0]
Time = 1.13 (sec) , antiderivative size = 119, normalized size of antiderivative = 1.31
method | result | size |
derivativedivides | \(\frac {\frac {2 \left (d^{2} a^{2}-2 a b c d +b^{2} c^{2}\right ) \arctan \left (\frac {2 c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+2 d}{2 \sqrt {c^{2}-d^{2}}}\right )}{d^{2} \sqrt {c^{2}-d^{2}}}+\frac {2 b \left (-\frac {b d}{1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )}+\left (2 d a -c b \right ) \arctan \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )\right )}{d^{2}}}{f}\) | \(119\) |
default | \(\frac {\frac {2 \left (d^{2} a^{2}-2 a b c d +b^{2} c^{2}\right ) \arctan \left (\frac {2 c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+2 d}{2 \sqrt {c^{2}-d^{2}}}\right )}{d^{2} \sqrt {c^{2}-d^{2}}}+\frac {2 b \left (-\frac {b d}{1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )}+\left (2 d a -c b \right ) \arctan \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )\right )}{d^{2}}}{f}\) | \(119\) |
risch | \(\frac {2 b x a}{d}-\frac {b^{2} x c}{d^{2}}-\frac {b^{2} {\mathrm e}^{i \left (f x +e \right )}}{2 d f}-\frac {b^{2} {\mathrm e}^{-i \left (f x +e \right )}}{2 d f}-\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i c \sqrt {-c^{2}+d^{2}}-c^{2}+d^{2}}{\sqrt {-c^{2}+d^{2}}\, d}\right ) a^{2}}{\sqrt {-c^{2}+d^{2}}\, f}+\frac {2 \ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i c \sqrt {-c^{2}+d^{2}}-c^{2}+d^{2}}{\sqrt {-c^{2}+d^{2}}\, d}\right ) a b c}{\sqrt {-c^{2}+d^{2}}\, f d}-\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i c \sqrt {-c^{2}+d^{2}}-c^{2}+d^{2}}{\sqrt {-c^{2}+d^{2}}\, d}\right ) b^{2} c^{2}}{\sqrt {-c^{2}+d^{2}}\, f \,d^{2}}+\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i c \sqrt {-c^{2}+d^{2}}+c^{2}-d^{2}}{\sqrt {-c^{2}+d^{2}}\, d}\right ) a^{2}}{\sqrt {-c^{2}+d^{2}}\, f}-\frac {2 \ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i c \sqrt {-c^{2}+d^{2}}+c^{2}-d^{2}}{\sqrt {-c^{2}+d^{2}}\, d}\right ) a b c}{\sqrt {-c^{2}+d^{2}}\, f d}+\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i c \sqrt {-c^{2}+d^{2}}+c^{2}-d^{2}}{\sqrt {-c^{2}+d^{2}}\, d}\right ) b^{2} c^{2}}{\sqrt {-c^{2}+d^{2}}\, f \,d^{2}}\) | \(490\) |
1/f*(2*(a^2*d^2-2*a*b*c*d+b^2*c^2)/d^2/(c^2-d^2)^(1/2)*arctan(1/2*(2*c*tan (1/2*f*x+1/2*e)+2*d)/(c^2-d^2)^(1/2))+2*b/d^2*(-b*d/(1+tan(1/2*f*x+1/2*e)^ 2)+(2*a*d-b*c)*arctan(tan(1/2*f*x+1/2*e))))
Time = 0.30 (sec) , antiderivative size = 375, normalized size of antiderivative = 4.12 \[ \int \frac {(3+b \sin (e+f x))^2}{c+d \sin (e+f x)} \, dx=\left [-\frac {2 \, {\left (b^{2} c^{3} - 2 \, a b c^{2} d - b^{2} c d^{2} + 2 \, a b d^{3}\right )} f x + {\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \sqrt {-c^{2} + d^{2}} \log \left (\frac {{\left (2 \, c^{2} - d^{2}\right )} \cos \left (f x + e\right )^{2} - 2 \, c d \sin \left (f x + e\right ) - c^{2} - d^{2} + 2 \, {\left (c \cos \left (f x + e\right ) \sin \left (f x + e\right ) + d \cos \left (f x + e\right )\right )} \sqrt {-c^{2} + d^{2}}}{d^{2} \cos \left (f x + e\right )^{2} - 2 \, c d \sin \left (f x + e\right ) - c^{2} - d^{2}}\right ) + 2 \, {\left (b^{2} c^{2} d - b^{2} d^{3}\right )} \cos \left (f x + e\right )}{2 \, {\left (c^{2} d^{2} - d^{4}\right )} f}, -\frac {{\left (b^{2} c^{3} - 2 \, a b c^{2} d - b^{2} c d^{2} + 2 \, a b d^{3}\right )} f x + {\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \sqrt {c^{2} - d^{2}} \arctan \left (-\frac {c \sin \left (f x + e\right ) + d}{\sqrt {c^{2} - d^{2}} \cos \left (f x + e\right )}\right ) + {\left (b^{2} c^{2} d - b^{2} d^{3}\right )} \cos \left (f x + e\right )}{{\left (c^{2} d^{2} - d^{4}\right )} f}\right ] \]
[-1/2*(2*(b^2*c^3 - 2*a*b*c^2*d - b^2*c*d^2 + 2*a*b*d^3)*f*x + (b^2*c^2 - 2*a*b*c*d + a^2*d^2)*sqrt(-c^2 + d^2)*log(((2*c^2 - d^2)*cos(f*x + e)^2 - 2*c*d*sin(f*x + e) - c^2 - d^2 + 2*(c*cos(f*x + e)*sin(f*x + e) + d*cos(f* x + e))*sqrt(-c^2 + d^2))/(d^2*cos(f*x + e)^2 - 2*c*d*sin(f*x + e) - c^2 - d^2)) + 2*(b^2*c^2*d - b^2*d^3)*cos(f*x + e))/((c^2*d^2 - d^4)*f), -((b^2 *c^3 - 2*a*b*c^2*d - b^2*c*d^2 + 2*a*b*d^3)*f*x + (b^2*c^2 - 2*a*b*c*d + a ^2*d^2)*sqrt(c^2 - d^2)*arctan(-(c*sin(f*x + e) + d)/(sqrt(c^2 - d^2)*cos( f*x + e))) + (b^2*c^2*d - b^2*d^3)*cos(f*x + e))/((c^2*d^2 - d^4)*f)]
Leaf count of result is larger than twice the leaf count of optimal. 4032 vs. \(2 (78) = 156\).
Time = 121.58 (sec) , antiderivative size = 4032, normalized size of antiderivative = 44.31 \[ \int \frac {(3+b \sin (e+f x))^2}{c+d \sin (e+f x)} \, dx=\text {Too large to display} \]
Piecewise((zoo*x*(a + b*sin(e))**2/sin(e), Eq(c, 0) & Eq(d, 0) & Eq(f, 0)) , ((a**2*log(tan(e/2 + f*x/2))*tan(e/2 + f*x/2)**2/(f*tan(e/2 + f*x/2)**2 + f) + a**2*log(tan(e/2 + f*x/2))/(f*tan(e/2 + f*x/2)**2 + f) + 2*a*b*f*x* tan(e/2 + f*x/2)**2/(f*tan(e/2 + f*x/2)**2 + f) + 2*a*b*f*x/(f*tan(e/2 + f *x/2)**2 + f) - 2*b**2/(f*tan(e/2 + f*x/2)**2 + f))/d, Eq(c, 0)), (2*a**2* d*sqrt(d**2)*tan(e/2 + f*x/2)**2/(d**3*f*tan(e/2 + f*x/2)**3 + d**3*f*tan( e/2 + f*x/2) - f*(d**2)**(3/2)*tan(e/2 + f*x/2)**2 - f*(d**2)**(3/2)) + 2* a**2*d*sqrt(d**2)/(d**3*f*tan(e/2 + f*x/2)**3 + d**3*f*tan(e/2 + f*x/2) - f*(d**2)**(3/2)*tan(e/2 + f*x/2)**2 - f*(d**2)**(3/2)) + 2*a*b*d**2*f*x*ta n(e/2 + f*x/2)**3/(d**3*f*tan(e/2 + f*x/2)**3 + d**3*f*tan(e/2 + f*x/2) - f*(d**2)**(3/2)*tan(e/2 + f*x/2)**2 - f*(d**2)**(3/2)) + 2*a*b*d**2*f*x*ta n(e/2 + f*x/2)/(d**3*f*tan(e/2 + f*x/2)**3 + d**3*f*tan(e/2 + f*x/2) - f*( d**2)**(3/2)*tan(e/2 + f*x/2)**2 - f*(d**2)**(3/2)) + 4*a*b*d**2*tan(e/2 + f*x/2)**2/(d**3*f*tan(e/2 + f*x/2)**3 + d**3*f*tan(e/2 + f*x/2) - f*(d**2 )**(3/2)*tan(e/2 + f*x/2)**2 - f*(d**2)**(3/2)) + 4*a*b*d**2/(d**3*f*tan(e /2 + f*x/2)**3 + d**3*f*tan(e/2 + f*x/2) - f*(d**2)**(3/2)*tan(e/2 + f*x/2 )**2 - f*(d**2)**(3/2)) - 2*a*b*d*f*x*sqrt(d**2)*tan(e/2 + f*x/2)**2/(d**3 *f*tan(e/2 + f*x/2)**3 + d**3*f*tan(e/2 + f*x/2) - f*(d**2)**(3/2)*tan(e/2 + f*x/2)**2 - f*(d**2)**(3/2)) - 2*a*b*d*f*x*sqrt(d**2)/(d**3*f*tan(e/2 + f*x/2)**3 + d**3*f*tan(e/2 + f*x/2) - f*(d**2)**(3/2)*tan(e/2 + f*x/2)...
Exception generated. \[ \int \frac {(3+b \sin (e+f x))^2}{c+d \sin (e+f x)} \, dx=\text {Exception raised: ValueError} \]
Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(4*d^2-4*c^2>0)', see `assume?` f or more de
Time = 0.31 (sec) , antiderivative size = 130, normalized size of antiderivative = 1.43 \[ \int \frac {(3+b \sin (e+f x))^2}{c+d \sin (e+f x)} \, dx=-\frac {\frac {{\left (b^{2} c - 2 \, a b d\right )} {\left (f x + e\right )}}{d^{2}} + \frac {2 \, b^{2}}{{\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 1\right )} d} - \frac {2 \, {\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} {\left (\pi \left \lfloor \frac {f x + e}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (c\right ) + \arctan \left (\frac {c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + d}{\sqrt {c^{2} - d^{2}}}\right )\right )}}{\sqrt {c^{2} - d^{2}} d^{2}}}{f} \]
-((b^2*c - 2*a*b*d)*(f*x + e)/d^2 + 2*b^2/((tan(1/2*f*x + 1/2*e)^2 + 1)*d) - 2*(b^2*c^2 - 2*a*b*c*d + a^2*d^2)*(pi*floor(1/2*(f*x + e)/pi + 1/2)*sgn (c) + arctan((c*tan(1/2*f*x + 1/2*e) + d)/sqrt(c^2 - d^2)))/(sqrt(c^2 - d^ 2)*d^2))/f
Time = 12.96 (sec) , antiderivative size = 2629, normalized size of antiderivative = 28.89 \[ \int \frac {(3+b \sin (e+f x))^2}{c+d \sin (e+f x)} \, dx=\text {Too large to display} \]
(2*b*atan((64*b^6*c^4*tan(e/2 + (f*x)/2))/(64*b^6*c^4 + 128*a^2*b^4*c^4 - 512*a^3*b^3*c*d^3 - 512*a^3*b^3*c^3*d + 768*a^2*b^4*c^2*d^2 + 576*a^4*b^2* c^2*d^2 - 384*a*b^5*c^3*d - 128*a^5*b*c*d^3) + (384*a*b^5*c^3*tan(e/2 + (f *x)/2))/(384*a*b^5*c^3 + 512*a^3*b^3*c^3 - (64*b^6*c^4)/d - 768*a^2*b^4*c^ 2*d + 512*a^3*b^3*c*d^2 - 576*a^4*b^2*c^2*d - (128*a^2*b^4*c^4)/d + 128*a^ 5*b*c*d^2) + (768*a^2*b^4*c^2*tan(e/2 + (f*x)/2))/(768*a^2*b^4*c^2 + 576*a ^4*b^2*c^2 + (64*b^6*c^4)/d^2 - (384*a*b^5*c^3)/d - 128*a^5*b*c*d - (512*a ^3*b^3*c^3)/d + (128*a^2*b^4*c^4)/d^2 - 512*a^3*b^3*c*d) + (576*a^4*b^2*c^ 2*tan(e/2 + (f*x)/2))/(768*a^2*b^4*c^2 + 576*a^4*b^2*c^2 + (64*b^6*c^4)/d^ 2 - (384*a*b^5*c^3)/d - 128*a^5*b*c*d - (512*a^3*b^3*c^3)/d + (128*a^2*b^4 *c^4)/d^2 - 512*a^3*b^3*c*d) + (512*a^3*b^3*c^3*tan(e/2 + (f*x)/2))/(384*a *b^5*c^3 + 512*a^3*b^3*c^3 - (64*b^6*c^4)/d - 768*a^2*b^4*c^2*d + 512*a^3* b^3*c*d^2 - 576*a^4*b^2*c^2*d - (128*a^2*b^4*c^4)/d + 128*a^5*b*c*d^2) + ( 128*a^2*b^4*c^4*tan(e/2 + (f*x)/2))/(64*b^6*c^4 + 128*a^2*b^4*c^4 - 512*a^ 3*b^3*c*d^3 - 512*a^3*b^3*c^3*d + 768*a^2*b^4*c^2*d^2 + 576*a^4*b^2*c^2*d^ 2 - 384*a*b^5*c^3*d - 128*a^5*b*c*d^3) - (128*a^5*b*c*d*tan(e/2 + (f*x)/2) )/(768*a^2*b^4*c^2 + 576*a^4*b^2*c^2 + (64*b^6*c^4)/d^2 - (384*a*b^5*c^3)/ d - 128*a^5*b*c*d - (512*a^3*b^3*c^3)/d + (128*a^2*b^4*c^4)/d^2 - 512*a^3* b^3*c*d) - (512*a^3*b^3*c*d*tan(e/2 + (f*x)/2))/(768*a^2*b^4*c^2 + 576*a^4 *b^2*c^2 + (64*b^6*c^4)/d^2 - (384*a*b^5*c^3)/d - 128*a^5*b*c*d - (512*...